{extend name="public/menu2" /}
{block name='title'}-{$cur.name}{/block}

{block name='content'}
<!--简介-->
<div class="right">
    <div class="right_content">
        <div class="recent_list">
            <ul>
                {foreach $content as $v}
                {php}$vid = $v['id'];{/php}
                <li>
                    <!--略缩图片-->
                    <div class="thum_img image">
                        <img src="{$v.cover ?: ''}" />
                    </div>
                    <!--培训内容-->
                    <div class="recent_content">
                        <h5>{$v.title ?: ''}</h5>
                        {foreach $v.cover_desc as $vv}
                        <div>{$vv}</div>
                        {/foreach}
                        <div class="recent_btn">
                            <a href='{:url("/lesson/$vid")}'><button>查看详情</button></a>
                        </div>
                    </div>
                </li>
                {/foreach}
            </ul>
        </div>
        <!--页码-->
        <div id="page"></div>

    </div>
</div>
</div>
{/block}

{block name='script'}
<link rel="stylesheet" type="text/css" href="__STATIC__/index/css/reset.css" />
<link rel="stylesheet" type="text/css" href="__STATIC__/index/css/teacher.css" />
<script src="__STATIC__/index/js/jquery.page.js"></script>

<script>
    $(function () {
        //获取url参数
        function getQueryValue(key) {
            var match = location.search.match(new RegExp(key + '=([^&]*)'));
            return match && match[1] || '';
        }
        // 当前页码
        var page = getQueryValue("page") || 1;
        page = parseInt(page);
        // 总页数
        var pageCount = '{$total ?: 1}';
        if (pageCount == 1) {
            $("#page").hide();
        }
        $("#page").createPage({
            current: page,
            pageCount: pageCount,
            backFn: function (p) {
                //p是当前页码
                location.href = "?page=" + p;
            }
        });
    })
</script>

{/block}